package com.sskj.one.mine;

import com.lzy.okrx2.adapter.FlowableBody;
import com.sskj.common.base.HttpData;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.lib.http.JsonConverter;
import com.sskj.one.bean.GonggaoBean;
import com.sskj.one.presenter.BasePresenter;

import java.util.List;

import io.reactivex.Flowable;
import okhttp3.Response;

/**
 * @author Hey
 * Create at  2019/05/22
 */
class GongGaoPresenter extends BasePresenter<GongGaoActivity> {

    public void getGonggaoList(boolean showLoading, int page, int size) {
        httpService.getGonggaoList(page, size)
                .tag(this)
                .execute(new JsonCallBack<HttpData<List<GonggaoBean>>>(showLoading ? this : null) {
                    @Override
                    public void onHTTPSuccess(HttpData<List<GonggaoBean>> data) {
                        mView.getGonggaoListOK(data.getData());
                    }

                    @Override
                    public void onFinish() {
                        super.onFinish();
                        mView.stopRefresh();
                    }
                });
    }
}
